#include "GameOperationModule.h"


GameOperationModule::GameOperationModule(void)
	:_view( nullptr )
{
}


GameOperationModule::~GameOperationModule(void)
{
}

bool GameOperationModule::init()
{
	_view = GameOperationView::create();
	_view->_upBtn->addTouchEventListener( this, toucheventselector(GameOperationModule::touchButton) );
	_view->_downBtn->addTouchEventListener( this, toucheventselector(GameOperationModule::touchButton) );
	return true;
}

void GameOperationModule::destroy()
{

}

void GameOperationModule::show( void* data )
{

}

void GameOperationModule::close()
{

}

void GameOperationModule::touchButton( Object* object,TouchEventType type )
{
	int tag = ((Node*)object)->getTag(); 
	switch (type)
	{
	case TOUCH_EVENT_ENDED:
		if (tag == 2)
		{
			log("up");
		}
		else if (tag == 3)
		{
			log("down");
		}
		break;
	default:
		break;
	}
}
